import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;

import java.io.IOException;
import java.net.InetSocketAddress;

/**
 * Created by sunwangdong on 2017/3/8.
 */
public class RPCClient {
    public static void main(String[] args) throws IOException {
        //获取远程访问的本地代理
        MyInterface proxy = RPC.getProxy(MyInterface.class, 1L, new InetSocketAddress("localhost", 8880), new Configuration());
//        int res = proxy.add(1,2);
        String res1 = proxy.findName(20210000000000L);
        String res2 = proxy.findName(20210123456789L);

        System.out.println("client=====>" + res1);
        System.out.println("client=====>" + res2);
    }
}
